;(function($){
	$.guest_multi_order = $.guest_multi_order || {}
	$.fn.guest_multi_order = function(opts){
		var el = this;
		var opt = {
			th:"",					//台号
			ct_brzd:{},				//手牌数据
			listDivId:"",			//选中菜品DIV
			operBtnDivId:"",		//按钮DIV
			jeDivId:"",				//合计金额DIV
			currentId:"1",			//已选中菜品
			datasource:[],			//数组
			bmh:"",
			tsyq:"",				//全单备注
			fwy : "",
			alertId:"#btnBack",				//提示按钮ID
			dataBack : function(){},
			closeBack : function(){},
			returnBack:function(){},
		}
		var param = $.extend(opt,opts);
		var app = new App(el,param);
		$.guest_multi_order = $.extend($.guest_multi_order,app);
	}
	
	var App = function(el,param){
		this.el = el;
		this.param = param;
		this.initHtml();
		this.initJs();
		this.bindEvent();
		this.changeList(param.datasource);
		this.changeNumber(param.datasource);
	}
	
	App.prototype = {
		bindEvent : function(){
			var el = this.el;
			var param = this.param;
			var t = this;
			
//			var eventOne = function(){ 
//				if(param.datasource.length>0){
//					jf_confirm_ync($.i18n.propJsp("是否落单"),function(res){
//						if(res=="是"){
//							$(".saveMenu").trigger("click");
//						}else if(res=="否"){
//							param.tsyq = "";
//							param.datasource=[]
//							param.dataBack()
//						}else if(res=="取消"){
//							
//						} 
//					})
//				}
//			}
			
//			$(param.alertId)[0].addEventListener("mousedown",eventOne,false);
	
			
			//返回
			$(".returnBackBtn").unbind("click").click(function(){
				param.returnBack();
			})
			
			//落单
			el.find(".saveMenu").unbind("click").click(function(){
				$.ajaxSetup({ async: false, cache: false }); 
				$.getScript("js/cashier_mana/posorderAdd.js"); 
				$.ajaxSetup({ async: true });
				param.currentStatus="normal"//设置状态为正常
				var data=[]
				var ct_brxsxm_tc=[]
				var savej={}
				$(param.datasource).each(function(k,v){
					savej={}
					for(var i in v){
						if(i=="pym"){
						}else if(i=="cb_bh"){
						}else if(i=="page"){
						}else if(i=="seq"){
							savej.xh=v.seq
						}else if(i=="tc_detail"){
							if(v[i]!=null){
//								tcjs = $.parseJSON(v[i]) 
								tcjs=v[i];
								$(tcjs).each(function(key,value){
									ct_brxsxm_tc.push(value)
								})
							}
						}else{
							savej[i]=v[i]
						}
					}
					data.push(savej)
				})
				if(param.datasource.length!=0){
					$("").posorderAdd({
						no:(param.ct_brzd.no||""),//no号
						data:data?data:"",//新菜数组
						ct_brxsxm_tc:ct_brxsxm_tc?ct_brxsxm_tc:"",
						//初始化数据返回回调
						getDefaultBack:function(data){
							param.tsyq = "";
							param.datasource=[]
							
							param.dataBack()
//							param.initBack(param.njson)
//							$(".widget-body .widget-main").empty()
//							param.unsubmit=0
//							param.getUnTotal()
//							param.saveBack()
//							param.dataBack()
//							param.goGledger();
						}
					});	
				}else{
					jf_alert("未提交菜品为空，请先选择菜品~");
				}
			})
			
			//助记码 or 分类
			$(".accountCode").unbind("click").click(function(){
				$(".accountCode").toggle();
				var type = $(this).data("type");
//	 			console.log(type)
				$("#goodsMenu").find(".pd_info").empty();
				if(type=="code"){
					$("#goodsCb").css({"height":"136"});
					setSize();
					$.spa_front_account_type.initCodeHtml();
				}else if(type=="type"){
					$("#goodsCb").css({"height":"110"});
					$("#nav-search").remove();
					setSize();
					$.spa_front_account_menu_multi.param.pym = "";
					$.spa_front_account_type.initGoodsCbHtml();
				}
			})
			
			//全单
			el.find(".orderRemark").unbind("click").click(function(){
				var title = "全单备注";
				if(param.datasource.length>0){
					$(this).modalFrame("destroy");
					$(this).modalFrame("init",function(modalEle){   
						$("#"+modalEle).modal("show"); 
						if(!$.isFunction($().orderRemark)){
							$.ajaxSetup({ async: false, cache: false });
				            $.getScript("js/cashier_mana/jquery.modal.orderRemark.js");
				            $.ajaxSetup({ async: true });
						}
						$("#"+modalEle).orderRemark({
							title:title?title:"",//标题
							list:param.datasource?param.datasource:"",//未提交菜品 
							tsyq : param.tsyq, 
							returnBack:function(){
								$("#"+modalEle).empty();
								$("#"+modalEle).modal("hide"); 
							},
							dataBack:function(goposorder){
								$("#"+modalEle).empty(); 
								$("#"+modalEle).modal("hide"); 
							},
							getDefaultBack:function(data){
								$("#"+modalEle).empty();
								$("#"+modalEle).modal("hide"); 
								param.tsyq = data.remark;
								$(data.relist).each(function(key,value){
									param.datasource[Number(value.xh)-1]["tsyq"] = data.remark;
								});
								
								t.changeList(param.datasource);
								t.changeNumber(param.datasource);
							}
						});
					});
				}else{
					jf_alert("请添加新的菜品 ~");
				}
			})
			
			
			//选中
			$("#"+param.listDivId).find(".dish_content").unbind("click").click(function(){
				$("#"+param.listDivId).find(".dish_content").removeClass("current")
				$(this).addClass("current")
				param.currentId = $(this).parent("div").attr("id")
			})
			
			//添加
			$("#"+param.operBtnDivId).find("#global_add").unbind("click").click(function(){
				var index = Number($("#"+param.listDivId).find(".current").parent("div").attr("id"))
				param.datasource[index-1]['sl'] = (Number(param.datasource[index-1]['sl'])+1).toFixed(2);
				t.changeList(param.datasource);
				t.changeNumber(param.datasource);
			})
			
			//减少
			$("#"+param.operBtnDivId).find("#global_reduce").unbind("click").click(function(){
				var index = Number($("#"+param.listDivId).find(".current").parent("div").attr("id"))
				if( (Number(param.datasource[index-1]['sl'])-1) <= 0){
					param.datasource.splice((index-1),1);
				}else{
					param.datasource[index-1]['sl'] = (Number(param.datasource[index-1]['sl'])-1).toFixed(2);
				}
				t.changeList(param.datasource);
				t.changeNumber(param.datasource);
			})
			
			//半份
			$("#"+param.operBtnDivId).find("#global_half").unbind("click").click(function(){
				var index = Number($("#"+param.listDivId).find(".current").parent("div").attr("id"))
				if( (Number(param.datasource[index-1]['sl'])) == 0.5){
					param.datasource[index-1]['sl'] = Number("1").toFixed(2);
				}else{
					param.datasource[index-1]['sl'] = Number("0.5").toFixed(2);
				}
				t.changeList(param.datasource);
				t.changeNumber(param.datasource);
			})
			
			//删除
			$("#"+param.operBtnDivId).find("#global_delete").unbind("click").click(function(){
				var index = Number($("#"+param.listDivId).find(".current").parent("div").attr("id"))
				param.datasource.splice((index-1),1);
				t.changeList(param.datasource);
				t.changeNumber(param.datasource);
			})
			
			//数量
			$("#"+param.operBtnDivId).find("#global_quantity").unbind("click").click(function(){
				var index = Number($("#"+param.listDivId).find(".current").parent("div").attr("id"))
				
				if(!$.isFunction($().digitalCalculator)){
					$.ajaxSetup({ async: false, cache: false });
		            $.getScript("js/openSpa/jquery.plugin.digitalCalculator.js");
		            $.ajaxSetup({ async: true });
				}
				$("#mykeyboard").digitalCalculator({
					number:param.datasource[index-1]['sl'],//数量
					status:status?status:true,
					title:param.datasource[index-1]['mc']+"-数量",
					//初始化数据返回回调
					dataBack:function(number){
						var number = parseInt(number);
						if(number<=0){
							param.datasource.splice((index-1),1);
						}else{
							param.datasource[index-1]['sl'] = number.toFixed(2);
						}
						t.changeList(param.datasource);
						t.changeNumber(param.datasource);
					}
				});
			})
			
			//单价
			$("#"+param.operBtnDivId).find("#global_unit").unbind("click").click(function(){
				var index = Number($("#"+param.listDivId).find(".current").parent("div").attr("id"))
				
				if(!$.isFunction($().digitalCalculator)){
					$.ajaxSetup({ async: false, cache: false });
		            $.getScript("js/openSpa/jquery.plugin.digitalCalculator.js");
		            $.ajaxSetup({ async: true });
				}
				$("#mykeyboard").digitalCalculator({
					number:param.datasource[index-1]['dj'],//数量
					status:status?status:true,
					title:param.datasource[index-1]['mc']+"-单价",
					//初始化数据返回回调
					dataBack:function(number){
						var number = parseInt(number);
						param.datasource[index-1]['dj'] = number.toFixed(2);
						
						t.changeList(param.datasource);
						t.changeNumber(param.datasource);
					}
				});
			})
			
			//赠送
			$("#"+param.operBtnDivId).find("#global_present").unbind("click").click(function(){
				var index = Number($("#"+param.listDivId).find(".current").parent("div").attr("id"))
				var currentjson = param.datasource[index-1]
				
				var bmh = param.bmh
				var js = getalinarg("赠送限额"+bmh)[0]; 
				if(JSON.stringify(js)=="{}"||parseFloat(currentjson.dj)<parseFloat(js.s_arg)){
					var text=currentjson.mc
					var current_num=currentjson.sl
					if(!$("#"+param.listDivId).find(".current").parent("div").hasClass("present")){//当前为设置赠送
						
						$(this).modalFrame("destroy");
						$(this).modalFrame("init",function(modalEle){  
							if(!$.isFunction($().present_reason)){
								$.ajaxSetup({async: false,cache: false });
					            $.getScript("js/cashier_mana/jquery.modal.present_reason.js");
					            $.ajaxSetup({async:true});
							}
							$("#"+modalEle).modal("show");
							$("#"+modalEle).present_reason({
								no:param.ct_brzd.no||"",
								closeBack:function(){
									return false;
								},
					    		dataBack:function(reason){ 
									param.datasource[index-1].discode="PRE"
									param.datasource[index-1].jgh = reason;
					    			$("#"+param.listDivId).find(".current").parent("div").addClass("present")//设置为赠送
					    			t.changeList(param.datasource);
									t.changeNumber(param.datasource);
					    		},
							});
						})
					}else{
						delete param.datasource[index-1].discode
						delete param.datasource[index-1].jgh
						$("#"+param.listDivId).find(".current").parent("div").removeClass("present")//取消为赠送
						t.changeList(param.datasource);
						t.changeNumber(param.datasource);
					}
				}else{
					jf_alert("超过赠送限额"+js.s_arg);
				}
			})
			
			//拼菜
			$("#"+param.operBtnDivId).find("#global_combine").unbind("click").click(function(){
				$(this).modalFrame("destroy");
				$(this).modalFrame("init",function(modalEle){   
					$("#"+modalEle).modal("show"); 
					if(!$.isFunction($().dish_cpkz)){
						$.ajaxSetup({ async: false, cache: false });
			            $.getScript("js/cashier_mana/jquery.modal.dish_cpkz.js");
			            $.ajaxSetup({ async: true });
					}
					$("#"+modalEle).dish_cpkz({
						ds : param.datasource,
						dataBack : function(){
							
						},
						closeBack : function(){
							
						}
					});
				});
			})
			
			//作法
			$("#"+param.operBtnDivId).find("#global_zf").unbind("click").click(function(){
				var index = Number($("#"+param.listDivId).find(".current").parent("div").attr("id"))
				var currentjson = param.datasource[index-1]
				
				$(this).modalFrame("destroy");
				$(this).modalFrame("init",function(modalEle){   
					$("#"+modalEle).modal("show"); 
					if(!$.isFunction($().dishZf)){
						$.ajaxSetup({ async: false, cache: false });
			            $.getScript("js/cashier_mana/jquery.modal.dishZf.js");
			            $.ajaxSetup({ async: true });
					}
					$("#"+modalEle).dishZf({
						title:$.i18n.propJsp("作法"),//标题
						bmh : param.bmh,
						njson : param.datasource,
//						list:currentjson?currentjson:"",//未提交菜品 
						ds : currentjson?currentjson:"",//未提交菜品 
						dataBack : function(){
							t.changeList(param.datasource);
							t.changeNumber(param.datasource);
						},
						closeBack : function(){
							
						},
						addZfDish : function(json){
							param.datasource.push(json)
							t.changeList(param.datasource);
							t.changeNumber(param.datasource);
//							debugger
						}
					});
				});
			})
			
			//编辑
			$("#"+param.operBtnDivId).find("#global_bianji").unbind("click").click(function(){
				var index = Number($("#"+param.listDivId).find(".current").parent("div").attr("id"))
				var currentjson = param.datasource[index-1]
				
				var oDate = new Date(); 
				var year=oDate.getFullYear();   
				var month=oDate.getMonth()+1;   
				var day=oDate.getDate(); 
				var hour=oDate.getHours(); 
				var min=oDate.getMinutes(); 
				var sen=oDate.getSeconds();
				var x = 32767;     
			    var y = 0;     
			    var rand = parseInt(Math.random() * (x - y + 1) + y);
			    var newId=year+""+month+""+day+""+hour+""+min+""+sen+""+rand;
			    $("body").append('<button class="hide" id="'+newId+'"></button>'); 
			    $("#"+newId).modalFrame("init",function(modalEle){ 
					$("#"+modalEle).modal("show"); 
					if(!$.isFunction($().specialDishes)){
						$.ajaxSetup({ async: false, cache: false });
			            $.getScript("js/cashier_mana/jquery.modal.service_SpecialDishes.js");
			            $.ajaxSetup({ async: true });
					}
					$("#"+modalEle).specialDishes({  
						data:currentjson, 
						enabled:currentjson.enabled,//可修改项 
						popup:currentjson.popup,//需要调用其他插件项 
						fwy : param.fwy,
						doPopup:false,
						returnBack:function(){
							$("#"+modalEle).modal("hide");
							$("#"+modalEle).empty();
							$("#"+modalEle).remove();
							$(".modal-backdrop").remove();
							$("#"+newId).remove();
						},
						dataBack:function(data){
							param.datasource[index-1] = data;
							t.changeList(param.datasource);
							t.changeNumber(param.datasource);
							$("#"+modalEle).modal("hide");
							$("#"+modalEle).empty();
							$("#"+modalEle).remove();
							$(".modal-backdrop").remove();
							$("#"+newId).remove();
						}
					});
				});
			})
			
			//套餐明细
			$("#"+param.operBtnDivId).find("#global_tc").unbind("click").click(function(){
				
			})
		},
		initHtml : function(){
			var el = this.el;
			var param = this.param;
			var t = this;
			
			$.ajaxSetup({async: false,cache: false});
            $.getScript("js/cashier_mana/jquery.service.spa_front_account_type.js");
            $.getScript("js/cashier_mana/jquery.service.spa_front_account_menu_multi.js");
            $.getScript("assets/js/fuelux/fuelux.spinner.js");
            $.getScript("assets/js/ace/elements.spinner.js");
            $.ajaxSetup({async: true});
            
            $("<link></link>").attr({
	            rel: "stylesheet",
	            type: 'text/css',
	            href: "css/cashier_mana/posorder.css",
	        }).appendTo(el)
	        
            var csstext = 	'<style>'+
            					'.page-content{padding-top: 12px !important;padding: 0px 20px 24px !important;}'+
								'button.dishes_type_each{margin:1px !important;}'+
								'.goodsCb .btn.btn-app{line-height: 22px;font-size: 20px;display: inline-block;font-weight: normal;border: none;border-radius: 6px;border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;padding: 12px 0 8px;margin: 1px;position: relative;}'+
								'.pd_info > a.btn.btn-app:focus,td .btn.btn-app:focus{border : 2px solid #d15b47 !important;background : #2b8ccc !important;color : white !important;}'+
								'.each_undish {width: 100% !important;padding: 0 !important;font-size: 13px !important;margin: -3px 0 !important;}'+
								'.each_undish .btn-app{width: calc(100% - 4px) !important; font-size:15px !important;border: none;    padding: 12px 0 8px;margin: 1px;position: relative;display: inline-block;}'+
								'.each_undish .btn.btn-app.btn-light.no-radius.dish_content.current{border:2px solid #d15b47 !important;margin : 2px;}'+ 
							'</style>';
			$(csstext).appendTo(el)
			
			
			
			$("#"+param.operBtnDivId).find(".oper_btn1").remove();
			var btnHtml = 	'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_add"><i class="ace-icon glyphicon glyphicon-plus icon-only bigger-120"></i></button>'+
							'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_reduce"><i class="ace-icon glyphicon glyphicon-minus icon-only bigger-120"></i></button>'+
//							'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_half">半份</button>'+
							'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_delete">删除</button>'+
							'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_quantity">数量</button>'+
							'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_unit">单价</button>'+
							'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_present">赠送</button>'+
							'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_combine">拼菜</button>'+
							'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_zf">作法</button>'+
							'<button class="btn btn-app btn-grey btn-xs oper_btn1" id="global_bianji">编辑</button>'+
							'<button class="btn btn-app btn-grey btn-xs oper_btn1 hide" id="global_tc">套餐明细</button>';
			$("#"+param.operBtnDivId).append(btnHtml)
			
			el.find("#guestOrder").remove()
			var html = 	'<div id="guestOrder">'+
							'<div id="menuContainer">'+
									'<div id="goodsCb" class="widget-box goodsCb" style="height:110px;">'+
								'</div>'+
								'<div id="goodsMenu" class="widget-box no-margin" style="" >'+
									'<div class="pd_info" style=""></div>'+
								'</div>'+
							'</div>'+
							'<div class="widget-box no-margin" style="height:73px;border-top:0px;padding: 6px;">'+
								'<button type="button" class="btn btn-app btn-sm btn-grey accountCode" data-type="code" style="height:58px;">'+
									'<span data-i18n="助记码" class="">助记码</span>'+
								'</button>'+
								'<button type="button" class="btn btn-app btn-sm btn-grey accountCode" data-type="type" style="height:58px;display:none;">'+
									'<span data-i18n="分类" class="">分类</span>'+
								'</button>'+
								'<button type="button" class="btn btn-app btn-sm btn-purple orderRemark" data-type="type" style="height:58px;">'+
									'<span data-i18n="全单" class="">全单</span>'+
								'</button>'+
								'<button type="button" class="btn btn-app btn-sm btn-grey returnBackBtn" data-type="type" style="height:58px;float:right;">'+
									'<span data-i18n="返回" class="">返回</span>'+
								'</button>'+
								'<button type="button" class="btn btn-app btn-sm btn-pink saveMenu" data-type="type" style="height:58px;float:right;">'+
									'<span data-i18n="落单" class="">落单</span>'+
								'</button>'+
							'</div>'+
						'</div>';
			el.append(html)
			
			el.find(".pd_info").css("height",$(window).height()-100-73-18-43-2-60)
		},
		initJs:function(){
			var el = this.el;
			var param = this.param;
			var t = this;
			
			//入账商品
			$("#goodsMenu").spa_front_account_menu_multi({
				wait : wait,
				goon : goon,
				bmh : $.HSAPI_HEADERS.bmh,
				th : param.th,
				ct_brzd:param.ct_brzd,
				fwy : param.fwy,
				width : $("#pageRight").width(),
				height : $("#goodsMenu").find(".pd_info").height(),
				dataBack : function(data){
					param.datasource = data
					t.changeList(data,'yes');
					t.changeNumber(data);
				},
				closeBack : function(){},
			})
			
			//入账商品大类
			$("#goodsCb").spa_front_account_type({
				ds : [],
				wait : wait,
				goon : goon,
				bmh : $.HSAPI_HEADERS.bmh,
				clickBack : function(ds){
					$.spa_front_account_menu_multi.param.page = 1;
					$.spa_front_account_menu_multi.param.cb_bh = ds.bh
					$.spa_front_account_menu_multi.initDs();
				},
				pymBack : function(pym){
					$.spa_front_account_menu_multi.param.page = 1;
					$.spa_front_account_menu_multi.param.pym = pym;
					$.spa_front_account_menu_multi.initDs();
				},
				dataBack : function(jdh){
				},
				closeBack : function(){
				}
			});
		},
		changeList:function(data,newDish){
			var el = this.el;
			var param = this.param;
			var t = this;
			
			var total = 0
			var count = 0
					
			console.log(JSON.stringify(data))
			if(Number(param.currentId)>data.length){
				param.currentId = data.length
			}
			if(Number(param.currentId)<1){
				param.currentId = 1
			}
			
			if(newDish && newDish=="yes"){
				param.currentId = data.length
			}
			
			$("#"+param.listDivId).empty()
			$.each(data,function(key,value){
				value.xh = (key+1);
				value.je = (Number(value.dj) * Number(value.sl)).toFixed(2)
				
				total += Number(value.je)	
				count = key+1	
				
				var current = ""
				if((key+1)==Number(param.currentId)){
					current = "current"
				}	
				
				var present = ""
				if(value.discode && value.discode=="PRE"){
					present = "present"
				}	
				
				var cpkz = ""
				if(value.cpkz && value.cpkz != ""){
					cpkz = $.i18n.propJsp("拼")+value.cpkz
				}
				
				var zf = ""
				if(value.zf && value.zf != ""){
					zf = value.zf
				}
				
				var tsyq = ""
				if(value.tsyq && value.tsyq != ""){
					tsyq = value.tsyq
				}
				
				var jgbh = ""
				if(value.jgbh && value.jgbh != ""){
					jgbh = value.jgbh
				}
//				debugger
				var html = 	'<div tabindex="" class="each_undish '+present+'" id="'+(key+1)+'" data-bh="'+value.bh+'">'+
								'<div class="btn btn-app btn-light no-radius dish_content '+current+'" data-id="tableView" style="padding: 12px 0 8px;background-image:linear-gradient(to bottom, #ffffff 0%, #ffffff 100%) !important">'+
									'<div class="each_top flex" style="line-height: 30px;">'+
										'<div class="eachName flex" style="color: #008000;margin-right: 2%;max-width: 60%;overflow: hidden;margin-left: 3%;">'+
											'<div class="dish_id">'+(key+1)+'.</div>&nbsp;'+
											'<div data-name="'+value.mc+'" class="dish_name">'+value.mc+'</div>&nbsp;'+
											((present=="present")?('<span style="color:red">(赠)</span>'):'')+
											'<div class="dish_cpkz '+(value.cpkz == ""?"hide":"")+'">'+cpkz+'</div>'+
										'</div>'+
										'<div class="eachRight flex" style="margin-left: auto;margin-right: 3%;">'+
											'<div class="eachPirce">'+value.dj+'/'+value.dw+'</div>×<div class="eachNumber" styl105e="color: #f89406;font-size: 22px !important;cursor: pointer;">'+Number(value.sl).toFixed(2)+'</div>'+
										'</div>'+
									'</div>'+
									'<div class="each_bottom flex" style="padding-left: 4%;line-height: 20px !important;">'+
										'<div class="badge badge-pink showtc hide">0</div>'+
										'<div class="eachJgbh '+(jgbh == ""?"hide":"")+'" style="font-size:12px;">服务员：'+jgbh+'</div>'+
										'<div class="eachZf '+(zf == ""?"hide":"")+'" style="font-size:12px;margin-left: 3%;">'+zf+'</div>'+
										'<div class="eachRemark  '+(tsyq == ""?"hide":"")+'" style="font-size:12px;margin-left: 3%;">'+tsyq+'</div>'+
									'</div>'+
								'</div>'+
								'<div class="sub_dishes"></div>'+
							'</div>';
				$("#"+param.listDivId).append(html)
			})
			
			var je = "￥"+total.toFixed(2)+"&nbsp;&nbsp;("+count+")"
			$("#"+param.jeDivId).html(je)
			
			t.bindEvent();
			
		},
		changeNumber:function(data){
			var el = this.el;
			var param = this.param;
			var t = this;
			
			$("#goodsMenu .bh_count").remove()
			$.each(data,function(key,value){
				if($("#goodsMenu").find("a[data-bh='"+value.bh+"']").find(".bh_count").size()>0){
					var number = (Number($("#goodsMenu").find("a[data-bh='"+value.bh+"']").find(".bh_count").text())+Number(value.sl)).toFixed(2)
					$("#goodsMenu").find("a[data-bh='"+value.bh+"']").find(".bh_count").text(number)
				}else{
					var html = '<span class="badge badge-warning badge-left bh_count" style="display: block;">'+value.sl+'</span>';
					$("#goodsMenu").find("a[data-bh='"+value.bh+"']").append(html)
				}
				
			})
			
		},
		
	}
	
	function setSize(){
		var winh = $(window).height();
		var top = $("#menuContainer").offset().top;
		var h = winh - top - 69-5;
		$("#menuContainer").css({"height":h});
		
		var top1 = $("#goodsMenu").find(".pd_info").offset().top;
		var hh = h - (top1 - top)-60;
		$("#goodsMenu").find(".pd_info").css("height",hh)
		
	}
})(jQuery);